<?php
/**
* This file is part of Webappkit, a packages system for PHP web apps
* @link http://webappkit.net
* @package dj
* @author J.Ducastel <jeremie@ducastel.name>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/


class DjHttpResponse extends HttpResponseBean {
	
	function DjHttpResponse($content=null) {
		$this->__construct($content);
	}
	
	function __construct($content=null,$mimeType=null,$status=200,$contentType='text/html') {
		if ($content) $this->setContent($content);
	}
	
	/**
	 * adds some content
	 * @access public
	 */
	function write($content) {
		$this->addContent($content);
	}
	
	// function has_header(header)
	
	//set_cookie(key, value='', max_age=None, expires=None, path='/', domain=None, secure=None
	
	// delete_cookie(key, path='/', domain=None)
	
	// function flush()
	
	
}

class DjHttpResponseNotFound extends DjHttpResponse {
	
	var $status=404;
	
	var $content=array('<html>
	<head>
		<title>Page not found</title>
	</head>
	<body>
		<h1>Page not found</h1>
		<p>This is an error 404</p>
	</body>
</html>');
}
/**
 *HttpResponse subclasses

Django includes a number of HttpResponse subclasses that handle different types of HTTP responses. Like HttpResponse, these subclasses live in django.http.

HttpResponseRedirect
    The constructor takes a single argument — the path to redirect to. This can be a fully qualified URL (e.g. 'http://www.yahoo.com/search/') or an absolute URL with no domain (e.g. '/search/'). Note that this returns an HTTP status code 302.
HttpResponsePermanentRedirect
    Like HttpResponseRedirect, but it returns a permanent redirect (HTTP status code 301) instead of a “found” redirect (status code 302).
HttpResponseNotModified
    The constructor doesn’t take any arguments. Use this to designate that a page hasn’t been modified since the user’s last request.
HttpResponseBadRequest
    New in Django development version. Acts just like HttpResponse but uses a 400 status code.
HttpResponseNotFound
    Acts just like HttpResponse but uses a 404 status code.
HttpResponseForbidden
    Acts just like HttpResponse but uses a 403 status code.
HttpResponseNotAllowed
    Like HttpResponse, but uses a 405 status code. Takes a single, required argument: a list of permitted methods (e.g. ['GET', 'POST']).
HttpResponseGone
    Acts just like HttpResponse but uses a 410 status code.
HttpResponseServerError
    Acts just like HttpResponse but uses a 500 status code.


 */
?>